/*

MERIDIAN  Caller program for Meridian Gravitas

(C) 23/9/88  A.Key

*/

#include <stdio.h>
#include <dos.h>
#include "standard.h"
#include "intvid.h"

char progname [] = "meridian";
static char sccs_id [] = "@(#)Meridian Gravitas  8/8/94";

/*...smain:0:*/
int main(int argc, char *argv [])
	{
	union REGS inregs, outregs;

	/* try for EGA with 3 or more pages */

	inregs.h.ah = VID_ALT_SELECT;
	inregs.h.bl = 0x10;		/* return EGA info */
	INTVID;
	if ( outregs.h.bh >= 0 && outregs.h.bh <= 1 &&
	     outregs.h.bl >= 0 && outregs.h.bl <= 3 )
		if ( outregs.h.bl != 0 )
			/* have got an EGA with 128K, 192K or 256K of memory */
			{
			execl("egamg.exe", "egamg", NULL);
			fprintf(stderr, "cannot find EGA version of Meridian\n");
			}
		else
			fprintf(stderr, "EGA card has insufficient memory\n");

	/* try for CGA */

	inregs.h.ah = VID_GET_MODE;
	INTVID;
	if ( outregs.h.al != 7 )
		/* are not working on text only IBM */
		{
		execl("cgamg.exe", "cgamg", NULL);
		fprintf(stderr, "cannot find CGA version of Meridian\n");
		}
	else
		fprintf(stderr, "Meridian requires EGA or CGA support\n");

	return 1;
	}
/*...e*/
